server: server.o tcp_thread_server.o udp_thread_server.o 
	g++ -o server server.o tcp_thread_server.o udp_thread_server.o -pthread

client: client.o tcp_thread_client.o udp_thread_client.o
	g++ -o client client.o tcp_thread_client.o udp_thread_client.o -pthread

server.o: server.cpp definitions.hpp
	g++ -g -c -Wall server.cpp

client.o: client.cpp definitions.hpp
	g++ -g -c -Wall client.cpp

tcp_thread_server.o: tcp_thread_server.cpp definitions.hpp
	g++ -g -c -Wall tcp_thread_server.cpp

tcp_thread_client.o: tcp_thread_client.cpp definitions.hpp
	g++ -g -c -Wall tcp_thread_client.cpp

udp_thread_server.o: udp_thread_server.cpp definitions.hpp
	g++ -g -c -Wall udp_thread_server.cpp

udp_thread_client.o: udp_thread_client.cpp definitions.hpp
	g++ -g -c -Wall udp_thread_client.cpp

clean:
	rm -f *.o server client
